﻿using Cinchoo.Core;
using Cinchoo.Core.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChoXsd
{
    [ChoConfigurationSection("applicationSettings", Silent=false, ConfigFilePath="applicationSettings.xml")]
    public class ChoAppSettings : ChoConfigurableObject
    {
        [ChoPropertyInfo("xsdExeFilePath", DefaultValue = @"C:\Program Files\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\xsd.exe")]
        [ChoNotNullOrEmptyValidator]
        public string XsdExeFilePath;

        protected override void OnAfterConfigurationObjectLoaded()
        {
            if (!File.Exists(XsdExeFilePath))
                throw new ApplicationException("Xsd tool '{0}' not found.".FormatString(XsdExeFilePath));
        }
    }
}
